<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';
$zbp->Load();
$action='root';
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}
if (!$zbp->CheckPlugin('Jz52_subinde')) {$zbp->ShowError(48);die();}
$blogtitle='文章内容目录索引';
require $blogpath . 'zb_system/admin/admin_header.php';
require $blogpath . 'zb_system/admin/admin_top.php';
if(isset($_POST['DelCon'])&&$zbp->VerifyCSRFToken($_POST['csrfToken'])){
	$zbp->Config('Jz52_subinde')->top = $_POST['top'];
	$zbp->Config('Jz52_subinde')->height = $_POST['height'];
	$zbp->Config('Jz52_subinde')->color = $_POST['color'];
	$zbp->Config('Jz52_subinde')->colorh = $_POST['colorh'];
	$zbp->Config('Jz52_subinde')->titeb = $_POST['titeb'];
	$zbp->Config('Jz52_subinde')->bodyc = $_POST['bodyc'];
	$zbp->Config('Jz52_subinde')->width = $_POST['width'];
	$zbp->Config('Jz52_subinde')->lorr = $_POST['lorr'];
	$zbp->Config('Jz52_subinde')->css = $_POST['css'];
	$zbp->Config('Jz52_subinde')->DelCon = $_POST['DelCon'];
	$zbp->SaveConfig('Jz52_subinde');
	$zbp->ShowHint('good', '保存成功！');
}
?>
<link href="source/colpick.css" rel="stylesheet" /> 
<script src="source/colpick.js" type="text/javascript"></script>
<style>
input.colorpicker { 
border-right-width: 25px; 
width: 84px; 
height: 25px;
line-height:25px;
cursor: pointer; 
font-family: 'Lucida Console', Monaco, monospace;
box-sizing: border-box;
padding:0;
margin-right:6px;
float:left;
}
.color-box-picker{
	padding:3px 
}
.table_hover > tbody > tr:hover > td,.table_hover > tbody > tr:hover > th{
    background-color: transparent;
}
table {
    box-shadow: none;
	border: 1px solid #eee;
}
strong {
background-color: #3a6ea5;
padding: 5px 10px;
color: #ffffff;
}
</style>
<div id="divMain">
  <div class="divHeader"><?php echo $blogtitle;?></div>
  <div class="SubMenu">
  </div>
  <div id="divMain2">
  <table name="form1" width="100%" style="padding:0;margin:0;" cellspacing="0" cellpadding="0" class="tableBorder">
	<br/>
	<tr>
    <td>	
		<p>1、使用本插件需要一定的CSS选择器以及JS知识</p>
		<p>2、免费插件不提供在线咨询服务，有问题可到 <a href="https://yeelz.com/post/471.html" target="_blank">插件发布页</a> 或者到应用中心留言</p>
		<p>3、欢迎加入交流群：236895886（验证：zblog）</p>
	</td>
	</tr>	
</table>
  
	<form id="form1" name="form1" method="post">
    <table width="100%" style='padding:0px;margin:0px;' cellspacing='0' cellpadding='0' class="tableBorder">
	  <input type="hidden" name="csrfToken" value="<?php echo $zbp->GetCSRFToken();?>">
	  <tr>
		<th width='20%'><p align="center">设置</p></th>
		<th width='50%'><p align="center">内容</p></th>
		<th width='20%'><p align="center">说明</p></th>
	  </tr>
	  
	  <tr>
		<td><b><p align="center">正文区域类名</p></b></td>
	   <td><p align="left">
	   <input type="text" id="bodyc" name="bodyc" value="<?php echo $zbp->Config('Jz52_subinde')->bodyc;?>" style="width:80%;"/>
	   </p></td>
	   <td>正文区域类名，插件抓取此区域内容生成索引，如默认主题/WhitePage/极致轻主题为.post-body、也轻主题为.news_con、拓源纯净主题为.single.postcon，可以用英文 , 隔开输入多个类名用以同时支持多个主题。</td>
	  </tr>
	  
	  <tr>
		<td><b><p align="center">索引标签</p></b></td>
	   <td><p align="left">
	   <input type="text" id="titeb" name="titeb" value="<?php echo $zbp->Config('Jz52_subinde')->titeb;?>" style="width:80%;"/>
	   </p></td>
	   <td>插件会抓取正文内容中的相关标签生成索引，用英文 , 隔开，如：h2,h3,h4</td>
	  </tr>

	  <tr>
		<td><b><p align="center">顶部距离</p></b></td>
	   <td><p align="left">
	   <input type="text" id="top" name="top" value="<?php echo $zbp->Config('Jz52_subinde')->top;?>" style="width:80%;"/>
	   </p></td>
	   <td>页面顶部距离，单位vh（1vh=1%视口高度）</td>
	  </tr>
	  
	  <tr>
		<td><b><p align="center">最大高度</p></b></td>
	   <td><p align="left">
	   <input type="text" id="height" name="height" value="<?php echo $zbp->Config('Jz52_subinde')->height;?>" style="width:80%;"/>
	   </p></td>
	   <td>索引区最大高度，单位vh，超过此高度则显示滚动条</td>
	  </tr>
	  

	  <tr>
		<td><b><p align="center">贴边距离</p></b></td>
	   <td><p align="left">
	   <input type="text" id="width" name="width" value="<?php echo $zbp->Config('Jz52_subinde')->width;?>" style="width:80%;"/>
	   </p></td>
	   <td>索引区贴边距离，单位px</td>
	  </tr>
	  
	  <tr>
		<td><b><p align="center">左右</p></b></td>
	   <td>
		<label>靠左：<input name="lorr" value="left" type="radio" <?php if ($zbp->Config('Jz52_subinde')->lorr=='left'){echo 'checked';}?>>&ensp;&ensp;</label>
		<label>靠右：<input name="lorr" value="right" type="radio" <?php if ($zbp->Config('Jz52_subinde')->lorr=='right'){echo 'checked';}?>>&ensp;&ensp;</label>
	   </td>
	   <td>索引区显示在页面左右位置</td>
	  </tr>
	  


	  <tr>
		<td><b><p align="center">自定义css</p></b></td>
	   <td><p align="left">
	   <textarea name="css" type="text" id="css" style="width: 80%;" ><?php echo $zbp->Config('Jz52_subinde')->css;?></textarea>
	   </p></td>
	   <td>自定义css</td>
	  </tr>
	  
	  
	  <tr>
		<td><b><p align="center">风格颜色配置</p></b></td>
	   <td><p align="left">
	   <div class="color-box-picker">
		正常
		<input type="text" id="bgpicker" class="colorpicker" name="color" value="<?php echo $zbp->Config('Jz52_subinde')->color;?>" style="border-color:#<?php echo $zbp->Config('Jz52_subinde')->color;?>" />
		</div>
		<div class="color-box-picker">
		激活
		<input type="text" id="bgpicker1" class="colorpicker" name="colorh" value="<?php echo $zbp->Config('Jz52_subinde')->colorh;?>" style="border-color:#<?php echo $zbp->Config('Jz52_subinde')->colorh;?>" />
		</div>

	   </p></td>
	   <td>提示页的颜色配置</td>
	  </tr>
	  


	  <tr>
		<td><b><p align="center">清空插件配置</p></b></td>
	   <td><p align="left">
	   <input type="text" id="DelCon" name="DelCon" class="checkbox" value="<?php echo $zbp->Config('Jz52_subinde')->DelCon;?>"/>
	   </p></td>
	   <td>开启后关闭插件会清空插件配置</td>
	  </tr>
	  
	</table>
 <br />
   <input name="" type="Submit" class="button" value="保存"/>
    </form>
  </div>
</div>
<script type="text/javascript">
ActiveTopMenu("topmenu_WhitePage");
AddHeaderIcon("<?php echo $zbp->host?>zb_system/image/common/themes_32.png");
$('#bgpicker,#bgpicker1').colpick({
	layout:'hex',
	submit:0,
	onChange:function(hsb,hex,rgb,el,bySetColor) {
		$(el).css('border-color','#'+hex);
		if(!bySetColor) $(el).val(hex);
	}
}).keyup(function(){
	$(this).colpickSetColor(this.value);
});

$('.color-box').click(function() {
	    var c = $(this).data('color');
		$('#bgpicker,#bgpicker1').colpickSetColor(c);
		$('#bgpicker,#bgpicker1').val(c );
		$('#bgpicker,#bgpicker1').css('border-color', '#'+c); 
});
</script> 
<?php
require $blogpath . 'zb_system/admin/admin_footer.php';
RunTime();
?>